home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 …ember: Reference Library / Dev.CD Dec 94.toast / Technical Documentation / Inside Macintosh / Operating System Utils / Operating System Utils.rsrc / TOC#_1000 < prev   
Encoding:
Text File  |  1994-10-25  |  12.9 KB  |  9 lines

  1. óOperating System UtilitiesContentsFigures, Tables, and ListingsAbout This BookFormat of a Typical ChapterConventions Used in This BookSpecial FontsTypes of NotesAssembly-Language InformationThe Development EnvironmentGestalt ManagerAbout the Gestalt ManagerUsing the Gestalt Manager4Determining Whether the Gestalt Manager Is Available4Listing 1-1    Determining whether Gestalt is available3Getting Information About the Operating Environment8Listing 1-2    Calling Gestalt and checking its result codeInterpreting Gestalt Responses7Table 1-1     Gestalt selector suffixes and their meanings6Listing 1-3    Interpreting a Gestalt attributes responseAdding a New Selector Code7Listing 1-4    Defining a simple Gestalt selector function-Listing 1-5    Installing a new Gestalt selectorModifying a Selector Function=Getting Environmental Information Without the Gestalt ManagerGestalt Manager Reference    ConstantsData StructuresThe System Environment RecordGestalt Manager Routines3Getting Information About the Operating EnvironmentGestalt SysEnvironsAdding a Selector Code
  2. NewGestaltModifying a Selector FunctionReplaceGestaltApplication-Defined RoutinesThe Selector FunctionMySelectorFunctionSummary of the Gestalt ManagerSystem Error HandlerAbout the System Error Handler'Figure 2-1    The system startup alert boxJFigure 2-2    The system startup alert box when extensions have been disabled%Figure 2-3    The system error alert boxSystem ErrorsTable 2-1    System error IDsResume Procedures:Figure 2-4    Handling of a nonfatal system error in System 7%Listing 2-1    A simple resume procedureSystem Error Handler ReferenceSystem Error Handler RoutinesSysErrorApplication-Defined Routines MyResumeProc    Resources%The System Error Alert Table Resource6Figure 2-5    The structure of a system error alert table/Figure 2-6    The structure of an alert definition-Figure 2-7    The structure of a text definition.Figure 2-8    The structure of an icon definition2Figure 2-9    The structure of a procedure definition0Figure 2-10    The structure of a button definition6Figure 2-11    The structure of a button-title definition$Summary of the System Error Handler"Mathematical and Logical Utilities,About the Mathematical and Logical Utilities"Bits, Bytes, Words, and Long Words"Figure 3-1    A byte set to 109 ($6D)8Table 3-1    Converting hexadecimal digits to binary valuesFigure 3-2    A word set to $3AD4'Figure 3-3    A long word set to $C24DAF2F'Bit Manipulation and Logical OperationsReversed Bit-Numbering Figure 3-4    Bit-numbering schemesData CompressionPseudorandom Number GenerationFixed-Point Data TypesFigure 3-5    The Fixed data typeFigure 3-6    The Fract data typeAngle-Slope ConversioniFigure 3-7    Some slope and line equivalencies using the conventions of the angle-slope conversion routines,Using the Mathematical and Logical Utilities+Performing Low-Level Manipulation of MemoryTesting and Manipulating BitsListing 3-1    Testing bits.Figure 3-8    A sample word (in MC680x0 notation)OListing 3-2    Determining whether a handle is purgeable using the BitTst function+Performing Logical Operations on Long Words2Figure 3-9    The BitAnd, BitOr, and BitXor functions-Figure 3-10    The BitNot and BitShift functions"Extracting a Word From a Long WordHardcoding Byte ValuesCompressing Data&Listing 3-3    Packing data to a resource5Listing 3-4    Decompressing data from a packed resourceObtaining Pseudorandom Numbers6Listing 3-5    Seeding the pseudo-random number generatorbListing 3-6    A simple way of obtaining a large random integer from a rangeof pseudo-random numbersKListing 3-7    Obtaining a pseudo random integer from a small range of numbers2Listing 3-8    Obtaining a pseudo-random long integerUsing Fixed-Point Data Types-Table 3-2    Routines for fixed-point data types-Mathematical and Logical Utilities ReferenceData Structures64-Bit Integer RecordRoutinesTesting and Setting BitsBitTstBitSetBitClrPerforming Logical OperationsBitAndBitOrBitXorBitNotBitShift!Getting and Setting Memory ValuesHiWordLoWordStuffHex"Compressing and Decompressing DataPackBits
  3. UnpackBitsObtaining a Pseudorandom NumberRandom)Converting Between Angle and Slope ValuesSlopeFromAngleAngleFromSlope,Multiplying and Dividing Fixed-Point NumbersFixMulFixDivFracMulFracDiv.Performing Calculations on Fixed-Point NumbersFracSqrtFracCosFracSinFixATan2%Converting Among 32-Bit Numeric TypesLong2FixFix2LongFix2FracFrac2Fix8Converting Between Fixed-Point and Floating-Point ValuesFix2XX2FixFrac2XX2Frac2Converting Between Fixed-Point and Integral ValuesFixRatioFixRoundMultiplying 32-bit valuesLongMul2Summary of the Mathematical and Logical Utilities%Date, Time, and Measurement Utilities/About the Date, Time, and Measurement UtilitiesDate and Time(Figure 4-1    The Date & Time control panel!Geographic Location and Time Zone Figure 4-2    The Map control panelSystem of Measurement=Figure 4-3    The numeric-format resource (resource type 'it10')Time Measurement/Using the Date, Time, and Measurement Utilities!Getting the Current Date and TimeLListing 4-1    Getting the current date and time with the GetDateTime procedureHListing 4-2    Getting the current date and time with the GetTime procedure!Setting the Current Date and TimeLListing 4-3    Changing the current date and time with the SetDateTime functionHListing 4-4    Changing the current date and time with the SetTime functionConverting Date-Time Formats.Listing 4-5    Manipulating date-time informationCalculating Dates1Listing 4-6    Calculating the 300th day of the year)Listing 4-7    Computing the day of the week'Working With Different Calendar SystemsMTable 4-1    Equivalent dates in the Gregorian, Arabic CLC, and Jewish calendarsÖTable 4-2    Values for the dayOfYear and weekOfYear fields for the date 1 Muharram 1414 and equivalent values in the Gregorian calendarwTable 4-3    Comparison of settings in fields of the long date-time record for Arabic CLC, Gregorian, and Jewish calendars/Handling Geographic Location and Time-Zone Data=Listing 4-8    Converting latitude and longitude to Fract valuesListing 4-9    Getting gmtDeltaListing 4-10    Setting gmtDelta"Determining the Measurement System5Listing 4-11    Getting the current units of measurement.Determining the Number of Elapsed Microseconds=Listing 4-12    Timing an event using the Microseconds procedure0Date, Time, and Measurement Utilities ReferenceData StructuresThe Date-Time Record9Long Date-Time Value and Long Date-Time Conversion RecordThe Long Date-Time RecordThe Geographic Location RecordThe Toggle Parameter BlockThe Unsigned Wide RecordRoutines(Table 4-4    Renamed and relocated routines!Getting the Current Date and Time ReadDateTime GetDateTimeGetTime!Setting the Current Date and Time SetDateTimeSetTime$Converting Between Date-Time FormatsSecondsToDateDateToSeconds(Converting Between Long Date-Time FormatLongSecondsToDateLongDateToSeconds.Modifying and Verifying Long Date-Time Records
  4. ToggleDate    ValidDate!Reading and Writing Location Data ReadLocationWriteLocation"Determining the Measurement SystemIsMetricMeasuring Time Microseconds5Summary of the Date, Time, and Measurement UtilitiesControl Panel ExtensionsAbout Control Panel Extensions'Figure 5-1    A control panel with a panel9Figure 5-2    Panel-selection pop-up menu in a control panel!Writing a Control Panel Extension;Creating a Component Resource for a Control Panel Extension>Listing 5-1    A component resource for a control panel extension7Dispatching to Control Panel Extension-Defined Routines4Listing 5-2    Handling Component Manager request codes#Installing and Removing Panel Items3Listing 5-3    Responding to the get-item list request-Listing 5-4    Responding to the install requestHandling Panel Items0Listing 5-5    Responding to an item-select requestHandling Events in a Panel1Listing 5-6    Responding to an event-select requestHandling Title RequestsManaging Control Panel Settings"Control Panel Extensions Reference(Control Panel Extension-Defined RoutinesManaging Panel ComponentsMyPanelGetDITLMyPanelInstallMyPanelGetTitleMyPanelRemoveHandling Panel Events MyPanelItem MyPanelEventManaging Panel SettingsMyPanelValidateInputMyPanelGetSettingsMyPanelSetSettings$Summary of Control Panel ExtensionsQueue Utilities About Queues$Figure 6-1    An operating-system queueThe Queue Header'Figure 6-2    The format of a queue headerThe Queue Element(Figure 6-3    The format of a queue element&Table 6-1    Operating-system queue typesXFigure 6-4    Formats of a vertical retrace queue element and a notification queue element Using the Queue Utilities5Searching for an Element in an Operating-System Queue3Listing 6-1    Searching for drives in the drive queue,Adding Elements to an Operating-System QueueCTable 6-2    Installation routines for operating-system queue elementsPListing 6-2    Using the Enqueue procedure to add a bank customer to a teller queue0Removing Elements From an Operating-System Queue8Table 6-3    Removal routines for operating-system elementsOListing 6-3    Using Dequeue to remove the first customer in the bank-teller queueQueue Utilities ReferenceData StructuresQueue HeadersQueue ElementsRoutinesEnqueueDequeueSummary of the Queue UtilitiesParameter RAM UtilitiesAbout Parameter RAM;Figure 7-1    Interaction between parameter RAM and low memory4Figure 7-2    The format of the system parameter recordETable 7-1    Default values for parameter RAM (for U.S. system software)!Using the Parameter RAM Utilities!Parameter RAM Utilities ReferenceData StructuresThe System Parameters RecordRoutinesInitUtil
  5. GetSysPPtr
  6. WriteParam'Summary of the Parameter RAM Utilities Trap ManagerAbout the Trap Manager4Figure 8-1    How the CPU processes A-line instructionsTrap Dispatch TablesFigure 8-2    Trap dispatch tables.Process for Accessing System Software Routines+Figure 8-3    Accessing the FillRect procedure%Patches and System Software Routines @Figure 8-4    Augmenting the FillRect procedure with a single patchDaisy Chain of PatchesHead Patch (Normal Patch)
  7. Tail Patch$Come-From Patch (Used Only by Apple)Patch for One ApplicationPatch for All ApplicationsA-Line Instructions$Figure 8-5    A-line instruction formatbFigure 8-6    Exception stack frame (on Macintosh computers with a MC68020 microprocessor or greater)1A-Line Instructions for Operating System Routines@Figure 8-7    An A-line instruction for an Operating System routine<Figure 8-8    The stack on entry to an Operating System routine/Calling Conventions for Register-Based Routines;Parameter-Passing Conventions for Operating System RoutinesFunction Results    Flag Bits(A-Line Instructions for Toolbox Routines6Figure 8-9    An A-line instruction for a Toolbox routine1Figure 8-10    Stack when entering a Toolbox routine,Calling Conventions for Stack-Based Routines%Figure 8-11    Pascal calling convention Figure 8-12    C calling convention2Parameter-Passing Conventions for Toolbox Routines/Table 8-1    Toolbox parameter-passing conventionsFunction ResultsBTable 8-2    Conventions for returning results from Toolbox functionsThe Auto-Pop BitAbout Trap MacrosAbout Routine SelectorsUsing the Trap Manager5Determining If a System Software Routine is AvailableAListing 8-1    Determining if a system software routine is availableGListing 8-2    Determining whether WaitNextEvent and Gestalt are available"Patching a System Software Routine;Listing 8-3    Patching the SysBeep Operating System procedure:Listing 8-4    Jumping to the next routine in the daisy chainListing 8-5    Installing a patchTrap Manager ReferenceRoutines1Accessing Addresses From the Trap Dispatch TablesGetOSTrapAddressGetToolboxTrapAddressNGetTrapAddress8Installing Patch Addresses Into the Trap Dispatch TablesSetOSTrapAddressSetToolboxTrapAddressNSetTrapAddress0Detecting Unimplemented System Software RoutinesUnimplemented8Manipulating One Trap Dispatch Table (Obsolete Routines)GetTrapAddressSetTrapAddressSummary of the Trap ManagerStart Manager!System Initialization and StartupSystem InitializationSystem Startup Boot BlocksGlobal Timing VariablesAbout the Start ManagerUsing the Start ManagerWriting a System ExtensionProfile of a System Extension-Listing 9-1    The MySampleINIT system extension2Defining the User Interface for a System Extension,Figure 9-1    The default system extension icon'Creating a System Extension’s Resources3Figure 9-2    Typical resources for a system extension%Creating Icons for a System Extension;Creating a System Heap Zone Resource for a System ExtensionBuilding a System ExtensionStart Manager ReferenceData Structures*The Default Startup Device Parameter Block(The Default Video Device Parameter Block,The Default Operating System Parameter BlockRoutines2Identifying and Setting the Default Startup DeviceGetDefaultStartupSetDefaultStartup0Identifying and Setting the Default Video DeviceGetVideoDefaultSetVideoDefault4Identifying and Setting the Default Operating System GetOSDefault SetOSDefault(Getting and Setting the Timeout Interval
  8. GetTimeout
  9. SetTimeoutSummary of the Start ManagerPackage ManagerAbout the Package Manager*Table 10-1    The standard Macintosh packagesUsing the Package ManagerPackage Manager ReferenceRoutinesInitialization of PackagesInitPack InitAllPacksSummary of the Package ManagerGlossaryIndex